package rpd.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import rpd.model.TbCandidateRecruitmentInfo;
import rpd.model.TbCandidateRecruitmentInfoExample;
import rpd.model.TbCandidateRecruitmentInfoKey;

public interface TbCandidateRecruitmentInfoMapper {
    long countByExample(TbCandidateRecruitmentInfoExample example);

    int deleteByExample(TbCandidateRecruitmentInfoExample example);

    @Delete({
        "delete from tb_candidate_recruitment_info",
        "where cri_id = #{criId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(TbCandidateRecruitmentInfoKey key);

    @Insert({
        "insert into tb_candidate_recruitment_info (cri_id, resume_id, ",
        "requirement_id, demand_time, ",
        "is_read, is_pass, tb_comment)",
        "values (#{criId,jdbcType=CHAR}, #{resumeId,jdbcType=CHAR}, ",
        "#{requirementId,jdbcType=CHAR}, #{demandTime,jdbcType=TIMESTAMP}, ",
        "#{isRead,jdbcType=CHAR}, #{isPass,jdbcType=CHAR}, #{tbComment,jdbcType=CHAR})"
    })
    int insert(TbCandidateRecruitmentInfo record);

    int insertSelective(TbCandidateRecruitmentInfo record);

    List<TbCandidateRecruitmentInfo> selectByExample(TbCandidateRecruitmentInfoExample example);

    @Select({
        "select",
        "cri_id, resume_id, requirement_id, demand_time, is_read, is_pass, tb_comment",
        "from tb_candidate_recruitment_info",
        "where cri_id = #{criId,jdbcType=CHAR}"
    })
    @ResultMap("rpd.mapper.TbCandidateRecruitmentInfoMapper.BaseResultMap")
    TbCandidateRecruitmentInfo selectByPrimaryKey(TbCandidateRecruitmentInfoKey key);

    int updateByExampleSelective(@Param("record") TbCandidateRecruitmentInfo record, @Param("example") TbCandidateRecruitmentInfoExample example);

    int updateByExample(@Param("record") TbCandidateRecruitmentInfo record, @Param("example") TbCandidateRecruitmentInfoExample example);

    int updateByPrimaryKeySelective(TbCandidateRecruitmentInfo record);

    @Update({
        "update tb_candidate_recruitment_info",
        "set resume_id = #{resumeId,jdbcType=CHAR},",
          "requirement_id = #{requirementId,jdbcType=CHAR},",
          "demand_time = #{demandTime,jdbcType=TIMESTAMP},",
          "is_read = #{isRead,jdbcType=CHAR},",
          "is_pass = #{isPass,jdbcType=CHAR},",
          "tb_comment = #{tbComment,jdbcType=CHAR}",
        "where cri_id = #{criId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(TbCandidateRecruitmentInfo record);
}